#ifndef RENDERERFACTORY_H_
#define RENDERERFACTORY_H_

//predecl
namespace cvRenderInterface	{ class RendererFactory; class IRenderer; };

//includes.

class RendererFactory
{
	public:
		enum RENDERER_OVERRIDES
		{
			RENDERER_NOOVERRIDE = 0,
			RENDERER_IMMEDIATEMODE,
			RENDERER_VBO,
			RENDERER_VBOWITHSHADERS,
			RENDERER_VAOWITHSHADERS
		};

		/**
		 * Overrides the search for optimal renderer and uses the overridden one instead
		 * @param override	Renderer override to use, see RENDERER_OVERRIDES -enumeration
		 */
		static void setRendererOverride( RENDERER_OVERRIDES override );

		/**
		 * Creates an optimal renderer for hardware. If RendererFactory::override is set to something other than
		 * RENDERER_NOOVERRIDE, the renderer is created based on override-setting
		 */
		static cvRenderInterface::IRenderer * createRenderer();

	private:
		RendererFactory();	//Never instantiate

		/// Feature wranglers
		static bool vaoSupported();
		static bool shadersSupported();
		static bool vboSupported();

		//Override-mode to force certain renderer, see RENDERER_OVERRIDES-enum
		static RENDERER_OVERRIDES override;
};

#endif /* RENDERERFACTORY_H_ */
